package com.ship.dispatch.service.fob;


import com.ship.common.core.base.PageBean;
import com.ship.common.business.service.BaseService;
import com.ship.dispatch.bean.fob.SpFobBaseBean;
import com.ship.dispatch.bpm.vo.ManageEntityVo;
import liquibase.pro.packaged.S;

import java.io.IOException;
import java.util.List;

/**
 *@title FobBaseService
 *@description  流程业务处理基础类
 *@author yl
 *@create 2023/12/14 0014
 */
public interface FobBaseService<T extends PageBean> extends BaseService<T>{
    /**
     * 维护业务实现类
     * @param manageEntityVo
     * @param json
     */
    void updateEntity(ManageEntityVo manageEntityVo,String json);

    /**
     * 查询方案id 在单据中是否存在
     * @param id
     * @return
     */
    SpFobBaseBean getBaseBeanByInstanceId(String id);

    /**
     * 保存实体
     * @param bean
     */
    void saveEntity(SpFobBaseBean bean);

    /**
     * 修改实体
     * @param bean
     */
    void updateEntityById(SpFobBaseBean bean);

    /**
     * 根据id 查询业务表单数据
     * @param id
     * @return
     */
    Object getFormData(String id,Long serviceId);

    /**
     * 根据表单数据获取模板填充数据
     * @param
     * @return
     */
    String getTemplateParam(ManageEntityVo manageEntityVo);

    /**
     * 处理多表单数据绑定
     * @param processInstanceId
     * @return
     */
    List<Long> findServieData(String processInstanceId);

   void createPayOrder(Long id) throws IOException;

   void createCostInfo(Long id,String key);

    /**
     * 开启流程审批
     * @param businessId 业务id
     */
   void startPostInstance(Long businessId,String key);

    /**
     * 校验审批是否通过
     * @param businessId
     * @return
     */
   boolean checkApproveStatus(Long businessId);

    /**
     * 审批结果监听
     * @param businessId
     * @param status
     */
   void updateApprovaResult(Long businessId,Integer status);

}
